package com.miracle.common.state.user;

import android.content.Context;

import com.miracle.common.bean.User.User;

/**
 * com.miracle.common.state.user
 * (c)2018 AIR Times Inc. All rights reserved.
 *
 *
 * @author WangJQ
 * @version 1.0
 * @date 2018/6/30 9:52
 * @see com.miracle.common.state.user
 */
public class LoginContext {
    public static LoginContext mLoginContext;
    private UserState mUserState = new LogOutState();

    public static LoginContext getLoginContext() {
        if (mLoginContext == null) {
            mLoginContext = new LoginContext();
        }
        return mLoginContext;
    }

    /**
     * 设置用户状态
     * @param state
     */
    public void setUserState(Context context, UserState state) {
        mUserState = state;
    }

    public void setUser(Context context, User user) {
        mUserState.setUser(context, user);
    }

}
